﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Garlic.CC.BaseClass;
using Garlic.CC.Utility;
using Garlic.BLL.Common;
using Garlic.DM.DataModel;
using Garlic.CC.WebUtility;
using Garlic.BLL;

public partial class SystemManagement_CodeDetailAdd : BasePage
{
    

    string code_name = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            code_name = Request.QueryString["code_name"];

            if (!(string.IsNullOrEmpty(code_name)))
            {                
                this.formCodeDetail.DefaultMode = FormViewMode.Insert;
                PageInit();
            }
            else
            {
                this.ShowMessage("页面需要代码名称信息！");
                //this.Response.Write("<script language=javascript>window.close();</script>"); 
            }            
        }
    }

    private void PageInit()
    {
        ((TextBox)this.formCodeDetail.FindControl("TextBoxCode_Name")).Text = code_name;
    }

    private void ShowMessage(string msg)
    {
        this.Message = msg;
    }

    protected void TopToolBar_OnClick(object sender, Garlic.UI.Components.IconButtonClickEventArgs args)
    {
        switch (args.Command)
        {
            case ToolbarCommand.Save:
                this.formCodeDetail.DataSourceID = "GetCodeDetailDataSource";
                this.formCodeDetail.InsertItem(true);
                break;
        }
    }
}
